using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DailyDiet.Models;
using DailyDiet.Services;
using DailyDiet.Services.Impl;
using DailyDiet.util;
using DailyDiet.ViewModels;
using JiebaNet.Segmenter;
using Moq;
using NUnit.Framework;

namespace DailyDietTest
{
    public class Tests
    {
        [SetUp]
        public void Setup()
        {
        }

        [Test]
        public void Test1()
        {
            Assert.Pass();
        }

        [Test]
        public void Preference() {
            List<Diet> diets = new List<Diet>();
            Diet diet1 = new Diet() {Id = 1};
            Diet diet2 = new Diet() {Id = 2};
            diets.Add(diet1);
            diets.Add(diet2);

            IPreferenceStorage preference = new PreferenceStorage();
        }

        [Test]
        public void DateTimeTest() {
            DateTime now = DateTime.Now;
            DateTime deadTime = Convert.ToDateTime(now.ToString("yy-MM-dd"))
                .AddDays(1);
            Console.WriteLine(deadTime);
        }

        [Test]
        public void test() {
            RecorderUtilService recorderUtilService =
                new RecorderUtilService(null, null);

            var list = recorderUtilService.GetAroundDateTime(new DateTime(2021,11,8),
                RecorderUtilConstant.LongTermModelMonth);

            foreach (var dateTime in list) {
                Console.WriteLine(dateTime.ToString("yyyy-MM-dd"));
            }
        }

        [Test]
        public async Task initialDietRecorder() {
            var preferenceMock = new Mock<IPreferenceStorage>();
            var mockedPreference = preferenceMock.Object;
            IDietRecorderStorageService dietRecorderStorage =
                new DietRecorderStorageService(mockedPreference);
            await dietRecorderStorage.InitializeAsync();
            IRecorderStorageFillMeassage recorderStorageFillMeassage =
                new RecorderStorageFillMeassage(dietRecorderStorage);

            await recorderStorageFillMeassage.initial();

            RecDietsDetailPageViewModel recDiets =
                new RecDietsDetailPageViewModel(null, null, null, null);
        }

        [Test]
        public async Task dateTest() {
            DateTime date = DateTime.Now;
            Console.WriteLine(Convert.ToInt32(date.DayOfWeek.ToString("d")));
        }
       

        
    }
}